package com.hpeng.search.dao.impl;


import java.util.List;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import com.hpeng.search.dao.SearchDao;
import com.hpeng.sys.model.AssetCard;
import com.hpeng.util.GenericDaoImpl;
import com.hpeng.util.Pagination;

@Component("searchDao")
public class SearchDaoImpl extends GenericDaoImpl<AssetCard,String> implements SearchDao{

	private JdbcTemplate jdbcTemplate;
	public List<AssetCard> getCategory(String sql) {
		return jdbcTemplate.queryForList(sql);
	}

	
	public Pagination<AssetCard> getPagination(int pageNumber,
			String[] hql, String order) {
		Pagination<AssetCard> pagination = null;
		StringBuffer sb = new StringBuffer();
		try {
			for (String str : hql) {
				sb.append(str);
			}
			pagination = this.getPagination(sb.toString() + order, null, pageNumber);
		} catch (Exception e) {
			e.printStackTrace();
		}

		return pagination;
	}
//	@Override
//	public List<AssetCard> getCategory(String sql, AssetCard card) {
//		return searchDao;
//	}
//		
}
